package Tasks;

import java.util.LinkedList;
import java.util.List;

import ru.ys.jsolver.interfaces.ITask;

public class FirstTask implements ITask{
	private Integer[] row0 = {1, 1};
	private Integer[] row1 = {2};
	private Integer[] row2 = {1, 1};
	private Integer[] row3 = {4};
	
	private Integer[] col0 = {1};
	private Integer[] col1 = {1, 1};
	private Integer[] col2 = {1, 1};
	private Integer[] col3 = {1, 1};
	private Integer[] col4 = {1, 1};
	private Integer[] col5 = {1};
	
	
	private List<Integer> generateList(Integer[] mas) {
		List<Integer> result = new LinkedList<Integer>();
		for (int i = 0; i < mas.length; i++) {
			result.add(mas[i]);
		}
		return result;
	}
	
	@Override
	public List<Integer> getCollumn(int i) {
		switch(i) {
		case 0: return generateList(col0);
		case 1: return generateList(col1);
		case 2: return generateList(col2);
		case 3: return generateList(col3);
		case 4: return generateList(col4);
		case 5: return generateList(col5);					
		}
		return null;
	}

	@Override
	public int getHeight() {		
		return 4;
	}

	@Override
	public List<Integer> getRow(int i) {		
		switch(i) {
		case 0: return generateList(row0);
		case 1: return generateList(row1);
		case 2: return generateList(row2);
		case 3: return generateList(row3);			
		}
		return null;
	}

	@Override
	public int getWidth() {
		return 6;
	}

}
